package com.example.dell.fastshopping.user.ensureMoney;

import com.example.dell.fastshopping.utils.DateUtils;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by ${YSH} on 2019/5/15.
 * 描述        ${TODO}
 * <p>
 * 更新者       $author$
 * 更新时间     $Data$
 * 描述         ${TODO}
 */
public class EnsureMoney {
    private List<EnsureMoney> list;

    public List<EnsureMoney> getList() {
        return list;
    }

    public void setList(List<EnsureMoney> list) {
        this.list = list;
    }

    //类型 时间 金额 参数未知
    private int typeno;//0:存 ，1 取 ，3 平台扣
    private int id;
    private String gradeName;
    private BigDecimal limitno;
    private long payTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setTypeno(int typeno) {
        this.typeno = typeno;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public void setLimitno(BigDecimal limitno) {
        this.limitno = limitno;
    }

    public void setPayTime(long payTime) {
        this.payTime = payTime;
    }

    public int getTypeno() {
        return typeno;
    }

    public String getGradeName() {
        return gradeName;
    }

    public BigDecimal getLimitno() {
        return limitno;
    }

    public long getPayTime() {
        return payTime;
    }

    public String getTypenoString() {
//        typeno;//0:存 ，1 取 ，3 平台扣
        String t = "";
        switch (typeno) {
            case 0:
                t = "存入";
                break;
            case 1:
                t = "取取";
                break;
            case 2:
                t = "平台扣款";
                break;

        }
        return t;
    }

    public String getPayTimeString() {
        return DateUtils.stampToDate(payTime);
    }

    public String getMoneyString() {
        if (limitno == null) {
            return "错误";
        } else {
            return limitno.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getTypenoStatus() {
//        typeno;//0:存 ，1 取 ，3 平台扣
        String t = "";
        switch (typeno) {
            case 0:
                t = "+";
                break;
            case 1:
                t = "-";
                break;
            case 2:
                t = "-";
                break;

        }
        return t;

    }
}
